<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>soup-method</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="libsoup Reference Manual">
<link rel="up" href="ch02.html" title="Core API">
<link rel="prev" href="SoupMessageBody.html" title="SoupMessageBody">
<link rel="next" href="libsoup-2.4-Soup-Miscellaneous-Utilities.html" title="Soup Miscellaneous Utilities">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="SoupMessageBody.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch02.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">libsoup Reference Manual</th>
<td><a accesskey="n" href="libsoup-2.4-Soup-Miscellaneous-Utilities.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#libsoup-2.4-soup-method.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#libsoup-2.4-soup-method.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="libsoup-2.4-soup-method"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libsoup-2.4-soup-method.top_of_page"></a>soup-method</span></h2>
<p>soup-method — HTTP method definitions</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="libsoup-2.4-soup-method.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;libsoup/soup.h&gt;

#define             <a class="link" href="libsoup-2.4-soup-method.html#SOUP-METHOD-OPTIONS:CAPS" title="SOUP_METHOD_OPTIONS">SOUP_METHOD_OPTIONS</a>
#define             <a class="link" href="libsoup-2.4-soup-method.html#SOUP-METHOD-GET:CAPS" title="SOUP_METHOD_GET">SOUP_METHOD_GET</a>
#define             <a class="link" href="libsoup-2.4-soup-method.html#SOUP-METHOD-HEAD:CAPS" title="SOUP_METHOD_HEAD">SOUP_METHOD_HEAD</a>
#define             <a class="link" href="libsoup-2.4-soup-method.html#SOUP-METHOD-PUT:CAPS" title="SOUP_METHOD_PUT">SOUP_METHOD_PUT</a>
#define             <a class="link" href="libsoup-2.4-soup-method.html#SOUP-METHOD-POST:CAPS" title="SOUP_METHOD_POST">SOUP_METHOD_POST</a>
#define             <a class="link" href="libsoup-2.4-soup-method.html#SOUP-METHOD-DELETE:CAPS" title="SOUP_METHOD_DELETE">SOUP_METHOD_DELETE</a>
#define             <a class="link" href="libsoup-2.4-soup-method.html#SOUP-METHOD-TRACE:CAPS" title="SOUP_METHOD_TRACE">SOUP_METHOD_TRACE</a>
#define             <a class="link" href="libsoup-2.4-soup-method.html#SOUP-METHOD-CONNECT:CAPS" title="SOUP_METHOD_CONNECT">SOUP_METHOD_CONNECT</a>

#define             <a class="link" href="libsoup-2.4-soup-method.html#SOUP-METHOD-PROPFIND:CAPS" title="SOUP_METHOD_PROPFIND">SOUP_METHOD_PROPFIND</a>
#define             <a class="link" href="libsoup-2.4-soup-method.html#SOUP-METHOD-PROPPATCH:CAPS" title="SOUP_METHOD_PROPPATCH">SOUP_METHOD_PROPPATCH</a>
#define             <a class="link" href="libsoup-2.4-soup-method.html#SOUP-METHOD-MKCOL:CAPS" title="SOUP_METHOD_MKCOL">SOUP_METHOD_MKCOL</a>
#define             <a class="link" href="libsoup-2.4-soup-method.html#SOUP-METHOD-COPY:CAPS" title="SOUP_METHOD_COPY">SOUP_METHOD_COPY</a>
#define             <a class="link" href="libsoup-2.4-soup-method.html#SOUP-METHOD-MOVE:CAPS" title="SOUP_METHOD_MOVE">SOUP_METHOD_MOVE</a>
#define             <a class="link" href="libsoup-2.4-soup-method.html#SOUP-METHOD-LOCK:CAPS" title="SOUP_METHOD_LOCK">SOUP_METHOD_LOCK</a>
#define             <a class="link" href="libsoup-2.4-soup-method.html#SOUP-METHOD-UNLOCK:CAPS" title="SOUP_METHOD_UNLOCK">SOUP_METHOD_UNLOCK</a>
</pre>
</div>
<div class="refsect1">
<a name="libsoup-2.4-soup-method.description"></a><h2>Description</h2>
<p>
soup-method.h contains a number of defines for standard HTTP and
WebDAV headers. You do not need to use these defines; you can pass
arbitrary strings to <a class="link" href="SoupMessage.html#soup-message-new" title="soup_message_new ()"><code class="function">soup_message_new()</code></a> if you prefer.
</p>
<p>
The thing that these defines <span class="emphasis"><em>are</em></span> useful for is
performing quick comparisons against <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a>'s <code class="literal">method</code> field;
because that field always contains an interned string, and these
macros return interned strings, you can compare <code class="literal">method</code> directly
against these macros rather than needing to use <code class="function">strcmp()</code>. This is
most useful in SoupServer handlers. Eg:
</p>
<p>
</p>
<div class="informalexample">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3
4</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">msg</span><span class="symbol">-&gt;</span><span class="normal">method </span><span class="symbol">!=</span><span class="normal"> <a href="libsoup-2.4-soup-method.html#SOUP-METHOD-GET:CAPS">SOUP_METHOD_GET</a> </span><span class="symbol">&amp;&amp;</span><span class="normal"> msg</span><span class="symbol">-&gt;</span><span class="normal">method </span><span class="symbol">!=</span><span class="normal"> <a href="libsoup-2.4-soup-method.html#SOUP-METHOD-HEAD:CAPS">SOUP_METHOD_HEAD</a></span><span class="symbol">)</span><span class="normal"> </span><span class="cbracket">{</span>
<span class="normal">    </span><span class="function"><a href="SoupMessage.html#soup-message-set-status">soup_message_set_status</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">msg</span><span class="symbol">,</span><span class="normal"> SOUP_METHOD_NOT_IMPLEMENTED</span><span class="symbol">);</span>
<span class="normal">    </span><span class="keyword">return</span><span class="symbol">;</span>
<span class="cbracket">}</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

<p>
</p>
</div>
<div class="refsect1">
<a name="libsoup-2.4-soup-method.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="SOUP-METHOD-OPTIONS:CAPS"></a><h3>SOUP_METHOD_OPTIONS</h3>
<pre class="programlisting">#define SOUP_METHOD_OPTIONS   _SOUP_INTERN_METHOD (OPTIONS)
</pre>
<p>
"OPTIONS" as an interned string.
</p>
</div>
<hr>
<div class="refsect2">
<a name="SOUP-METHOD-GET:CAPS"></a><h3>SOUP_METHOD_GET</h3>
<pre class="programlisting">#define SOUP_METHOD_GET       _SOUP_INTERN_METHOD (GET)
</pre>
<p>
"GET" as an interned string.
</p>
</div>
<hr>
<div class="refsect2">
<a name="SOUP-METHOD-HEAD:CAPS"></a><h3>SOUP_METHOD_HEAD</h3>
<pre class="programlisting">#define SOUP_METHOD_HEAD      _SOUP_INTERN_METHOD (HEAD)
</pre>
<p>
"HEAD" as an interned string.
</p>
</div>
<hr>
<div class="refsect2">
<a name="SOUP-METHOD-PUT:CAPS"></a><h3>SOUP_METHOD_PUT</h3>
<pre class="programlisting">#define SOUP_METHOD_PUT       _SOUP_INTERN_METHOD (PUT)
</pre>
<p>
"PUT" as an interned string.
</p>
</div>
<hr>
<div class="refsect2">
<a name="SOUP-METHOD-POST:CAPS"></a><h3>SOUP_METHOD_POST</h3>
<pre class="programlisting">#define SOUP_METHOD_POST      _SOUP_INTERN_METHOD (POST)
</pre>
<p>
"POST" as an interned string.
</p>
</div>
<hr>
<div class="refsect2">
<a name="SOUP-METHOD-DELETE:CAPS"></a><h3>SOUP_METHOD_DELETE</h3>
<pre class="programlisting">#define SOUP_METHOD_DELETE    _SOUP_INTERN_METHOD (DELETE)
</pre>
<p>
"DELETE" as an interned string.
</p>
</div>
<hr>
<div class="refsect2">
<a name="SOUP-METHOD-TRACE:CAPS"></a><h3>SOUP_METHOD_TRACE</h3>
<pre class="programlisting">#define SOUP_METHOD_TRACE     _SOUP_INTERN_METHOD (TRACE)
</pre>
<p>
"TRACE" as an interned string.
</p>
</div>
<hr>
<div class="refsect2">
<a name="SOUP-METHOD-CONNECT:CAPS"></a><h3>SOUP_METHOD_CONNECT</h3>
<pre class="programlisting">#define SOUP_METHOD_CONNECT   _SOUP_INTERN_METHOD (CONNECT)
</pre>
<p>
"CONNECT" as an interned string.
</p>
</div>
<hr>
<div class="refsect2">
<a name="SOUP-METHOD-PROPFIND:CAPS"></a><h3>SOUP_METHOD_PROPFIND</h3>
<pre class="programlisting">#define SOUP_METHOD_PROPFIND  _SOUP_INTERN_METHOD (PROPFIND)
</pre>
<p>
"PROPFIND" as an interned string.
</p>
</div>
<hr>
<div class="refsect2">
<a name="SOUP-METHOD-PROPPATCH:CAPS"></a><h3>SOUP_METHOD_PROPPATCH</h3>
<pre class="programlisting">#define SOUP_METHOD_PROPPATCH _SOUP_INTERN_METHOD (PROPPATCH)
</pre>
<p>
"PROPPATCH" as an interned string.
</p>
</div>
<hr>
<div class="refsect2">
<a name="SOUP-METHOD-MKCOL:CAPS"></a><h3>SOUP_METHOD_MKCOL</h3>
<pre class="programlisting">#define SOUP_METHOD_MKCOL     _SOUP_INTERN_METHOD (MKCOL)
</pre>
<p>
"MKCOL" as an interned string.
</p>
</div>
<hr>
<div class="refsect2">
<a name="SOUP-METHOD-COPY:CAPS"></a><h3>SOUP_METHOD_COPY</h3>
<pre class="programlisting">#define SOUP_METHOD_COPY      _SOUP_INTERN_METHOD (COPY)
</pre>
<p>
"COPY" as an interned string.
</p>
</div>
<hr>
<div class="refsect2">
<a name="SOUP-METHOD-MOVE:CAPS"></a><h3>SOUP_METHOD_MOVE</h3>
<pre class="programlisting">#define SOUP_METHOD_MOVE      _SOUP_INTERN_METHOD (MOVE)
</pre>
<p>
"MOVE" as an interned string.
</p>
</div>
<hr>
<div class="refsect2">
<a name="SOUP-METHOD-LOCK:CAPS"></a><h3>SOUP_METHOD_LOCK</h3>
<pre class="programlisting">#define SOUP_METHOD_LOCK      _SOUP_INTERN_METHOD (LOCK)
</pre>
<p>
"LOCK" as an interned string.
</p>
</div>
<hr>
<div class="refsect2">
<a name="SOUP-METHOD-UNLOCK:CAPS"></a><h3>SOUP_METHOD_UNLOCK</h3>
<pre class="programlisting">#define SOUP_METHOD_UNLOCK    _SOUP_INTERN_METHOD (UNLOCK)
</pre>
<p>
"UNLOCK" as an interned string.
</p>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>